package com.kaifamiao.month05.day18;

import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;

public class Demo02 {

    public static void main(String[] args) {

        Class<?> t = Teacher.class;
        try {
            PropertyDescriptor prop = new PropertyDescriptor("age",t);
            Class<?> c = prop.getReadMethod().getReturnType();
            System.out.println(c);
        } catch (IntrospectionException e) {
            throw new RuntimeException(e);
        }

    }
}

class Teacher{


    private String name;
    private double age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getAge() {
        return age;
    }

    public void setAge(double age) {
        this.age = age;
    }

    public int a() {
        return 0;
    }
}
